import request from '@/utils/request'

const api_name = '/eduservice/chapter'

// 课程章节接口
export default {

    //根据课程id，获取章节和小节数据信息
    addCourseInfo(courseId) {
        return request({
            url: `${api_name}/getChapterVideo/${courseId}`,
            method: 'get'
        })
    },

    //添加章节
    addChapter(eduChapter) {
        return request({
            url: `${api_name}/addChapter`,
            method: 'post',
            data: eduChapter
        })
    },

    //根据章节id查询章节
    getChapterById(chapterId) {
        return request({
            url: `${api_name}/getChapterById/${chapterId}`,
            method: 'get'
        })
    },

    //根据id更新章节
    updateByIds(eduChapter) {
        return request({
            url: `${api_name}/updateByIds`,
            method: 'post',
            data: eduChapter
        })
    },

    //按id删除章节
    deleteChapter(chapterId) {
        return request({
            url: `${api_name}/deleteChapter/${chapterId}`,
            method: 'delete'
        })
    },

}